import java.util.Objects;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 周斌
 * Date: 2024-04-09
 * Time: 22:43
 */
class Student{
    public String id;

    public Student(String id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "Student{" +
                "id='" + id + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return Objects.equals(id, student.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
public class HashBuck2Test {

    public static void main(String[] args) {
        Student student1 = new Student("11111");
        Student student2 = new Student("123456");
        HashBuck2<Student,Integer> hashBuck2 = new HashBuck2<>();
        hashBuck2.push(student1,11);
        hashBuck2.push(student2,22);
        System.out.println(hashBuck2.get(student1));
    }
}
